package com.ruoyi.order.service.impl;

import com.ruoyi.order.domain.TbOrder;
import com.ruoyi.order.mapper.TbOrderDevMapper;
import com.ruoyi.order.service.ITbOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * 订单Service业务层处理
 * 
 * @author 12692
 * @date 2023-06-26
 */
@Service
public class TbOrderServiceImpl implements ITbOrderService 
{
    @Autowired
    private TbOrderDevMapper tbOrderMapper;

    /**
     * 新增订单
     * 
     * @param tbOrder 订单
     * @return 结果
     */
    @Override
    public int insertTbOrderOne(TbOrder tbOrder)
    {
        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
        tbOrder.setOrderId(uuid);
        return tbOrderMapper.insertTbOrderOne(tbOrder);
    }

    /**
     * 新增订单
     *
     * @param tbOrder 订单
     * @return 结果
     */
    @Override
    public int insertTbOrderThree(TbOrder tbOrder)
    {
        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
        tbOrder.setOrderId(uuid);
        return tbOrderMapper.insertTbOrderThree(tbOrder);
    }
}
